#include<iostream>
using namespace std;

int main()
{
    int seconds, hour, minutes;
    cin >> seconds;
    hour = seconds / 3600;
    seconds  = seconds % 3600;
    minutes = seconds / 60;
    seconds = seconds % 60;
    cout << hour << " " << minutes << " " << seconds << endl; 
    
    return 0;
}
